1. Technical Field
The present invention provides an improved data processing system and in particular a method and apparatus for processing documents. Still more particularly, the present invention provides a method and apparatus for creating stylesheets for documents.
2. Description of Related Art
Extensible markup language (XML) is fast becoming a powerful replacement for hypertext markup language(HTML). Both are based on standard generalized markup language (SGML), but XML provides a way to describe an arbitrary tag set. Since XML does not describe how to display a document marked up with arbitrary elements, some style information must be associated with XML to know how to display the document. This mechanism is different from HTML in which all elements are determined by standards so any browser knows how to display the data.
Extensible stylesheet language (XSL) is an XML vocabulary for defining stylesheets. Part of the family of emerging XML standards, XSL defines a mechanism for converting a document type into another one. Advantages are present for the separation of style from content. For example, styles can be standardized and reused for different applications. Also, the separation of style from content makes it possible to apply multiple styles to the same document. Further, content authors do not have to worry about style issues with this type of system.
Although a great deal of expressive power is present in XSL, this power comes at a price. The mechanics of building templates requires a considerable amount of expertise and scripting skills. To further complicate matters, because XSL is a declarative language, many programmers of traditional programming languages face a significant amount of training as they begin to work with XSL. Besides, even if a programmer can handle XSL, the development process can be time consuming and error prone at times. Finally, it is hard to keep up with many different target document styles that a manual XSL stylesheet development process must deal with.
Two primary approaches to designing a style markup language exist. These two approaches are procedural and declarative. Using a procedural approach, the programmer defines what is to be done, often using a scripting language. Using a declarative approach, the programmer only needs to describe the characteristics and constraints to be obeyed and not be so concerned with xe2x80x9chowxe2x80x9d it is done. XSL uses a declarative approach to designing stylesheets. Unfortunately many programmers are unfamiliar with a declarative style of programming, a need exists for an easier way to implement XSL stylesheets.
The present invention provides a method and apparatus in a data processing system for converting documents. Source elements and corresponding target elements are identified. An initial target document derived from a source document is presented using the source elements and corresponding target elements. User input is received modifying presentation of the initial target document to form a final target document. Differences between the initial target document and the final target document are identified. A stylesheet is created to convert source documents into target documents using the identified source elements and corresponding target elements and the identified differences between the initial target document and the final target document.